﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace Store.Models
{
    public class Goods : BaseEnity
    {
        [StringLength(100)]
        public string Name { get; set; }

        public decimal Price { get; set; }

        [Column(TypeName = "ntext")]
        public string Content { get; set; }

        /// <summary>
        /// 市场价格
        /// </summary>
        public decimal Marketprice { get; set; }

        /// <summary>
        /// 库存
        /// </summary>
        public int Count { get; set; } = 0;

        #region 导航属性 关连商品类别
        public Guid GoodsTypeId { get; set; }
        public GoodsType GoodsTypes { get; set; }
        #endregion

        /// <summary>
        /// 外键 商品评价
        /// </summary>
        public List<GoodsEvaluate> GoodsEvaluates { get; set; }

        /// <summary>
        /// 外键 收藏夹
        /// </summary>
        public List<Favorite> Favorites { get; set; }

        /// <summary>
        /// 外键 购物车
        /// </summary>
        public List<ShoppingTrolley> ShoppingTrolleys { get; set; }

        /// <summary>
        /// 外键 订单详情
        /// </summary>
        public List<OrderInfo> orderInfos { get; set; }
    }
}
